package com.yxsa.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxsa.entity.Order;
import com.yxsa.mapper.OrderMapper;
import com.yxsa.service.OrderDeduct;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

@Service
@Transactional(rollbackFor = Exception.class)
public class OrderDeductImpl extends ServiceImpl<OrderMapper, Order> implements OrderDeduct {
    @Override
    public Boolean save(String commodityCode, Integer count){
        Order order = new Order();
        String s = UUID.randomUUID().toString().replaceAll("-", "");
        order.setMoney(34);
        order.setName(commodityCode);
        order.setCount(count);
        this.baseMapper.insert(order);
        return true;
    }
}
